<template>
	<div class="test-success">
		<div style="background:white;padding:1.5rem;">
			<h1>
				普洗服务(轿车)
				<button>待服务</button>
			</h1>
			<div>
				<p>
					<span>商户名</span>
					趣动俱乐部
				</p>
				<p>
					<span>实收款</span>
					￥20
				</p>
				<p>
					<span>订单编号</span>
					13456465
				</p>
				<p>
					<span>付款时间</span>
					2017/8/5
				</p>
				<p>
					<span>用户</span>
					趣动俱乐部
				</p>
			</div>
		</div>
		<button class="btn" @touchend="goindex">确认</button>
	</div>
</template>

<script>
    // import { comm_default } from "./comm/comm.js";
	export default {
		
		data(){
			return ({
				list:{
					merchantServe:{
						serviceName:'普洗',
						serviceType:{
							name:'轿车普洗'
						}
					},
					orderStatus:'待服务',
					merchant:{
						fullName:'世界，你好'
					},
					realAmount:'20',
					orderNumber:'123456789',
					payTime:'2017-8',
					userName:'任开'
				}
			})
		},
		methods:{
			goindex(){
				let This=this;
				$.get(`${comm_default.requestSH}/order/updateOrderServiceStatus`,{
					code:'12',
					serveCode:this.$route.query.servicecode,
					merchantCode:$.cookie('sh_usercode')
				},function(data){
					if(data.executed){
						alert('验证成功');
						This.$router.push({path:'/'})
					}
				});
			},
			date(timestamp){
				var date;
				//时间戳为10位需*1000，时间戳为13位的话不需乘1000
				if(timestamp.toString().length==10){
					date=new Date(Number(timestamp) * 1000);
				}
				if(timestamp.toString().length==13){
					date=new Date(Number(timestamp));
				}
		        let Y = date.getFullYear() + '-';
		        let M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
		        let D = date.getDate() + ' ';
		        let h = date.getHours() + ':';
		        let m = date.getMinutes() + ':';
		        let s = date.getSeconds();
		        return Y+M+D+h+m+s;
			}
		}
	}
</script>

<style scoped>
    h1,p,button{
		margin: 0;
		padding:0;
		border: none;
	}
	.test-success{
		position: absolute;
		top:0;
		bottom: 0;
		left: 0;
		right:0;
		background: #f7f7f7;
	}
	h1{
		padding-bottom: 1rem;
		border-bottom: 1px solid #efefef;
		font-family: 'Microsoft JhengHei';
		font-weight: 600;
		font-size:1.8rem;
	}
	h1 > button {
		float: right;
		padding:0.2rem 0.9rem;
		background: #f08b16;
		color:white;
	}
	p{
		margin: 1rem 0;
	}
	p span{
		display: inline-block;
		width: 5rem;
		margin-right: 1rem;
		text-align: right;
		color:#b7b7b7;
	}
	.btn{
		width: 92%;
		height:3.6rem;
		margin: 1.5rem 4%;
		background: #179ef0;
		color:white;
	}
</style>